import request from '@/config/axios'

// 耗料 VO
export interface ConsumeVO {
  id: number // id
  houseId: number // 农舍
  weight: number // 耗料
  description: string // 描述
  status: number // 状态
}

// 耗料 API
export const ConsumeApi = {
  // 查询耗料分页
  getConsumePage: async (params: any) => {
    return await request.get({ url: `/farm/consume/page`, params })
  },

  // 查询耗料详情
  getConsume: async (id: number) => {
    return await request.get({ url: `/farm/consume/get?id=` + id })
  },

  // 新增耗料
  createConsume: async (data: ConsumeVO) => {
    return await request.post({ url: `/farm/consume/create`, data })
  },

  // 修改耗料
  updateConsume: async (data: ConsumeVO) => {
    return await request.put({ url: `/farm/consume/update`, data })
  },

  // 删除耗料
  deleteConsume: async (id: number) => {
    return await request.delete({ url: `/farm/consume/delete?id=` + id })
  },

  // 导出耗料 Excel
  exportConsume: async (params) => {
    return await request.download({ url: `/farm/consume/export-excel`, params })
  },
    // 下载耗料导入模板=
    importComsumeTemplate:async() => {
      return request.download({
        url: '/farm/consume/get-import-template' 
      })
    }
}
